Blog

Launching Shells

If your favorite IDE is Eclipse and you use the Alias Maven Plugin you need to launch a shell from within your IDE.

This article will show you some of your options.

Options

There are a couple of interesting plugins you can choose from.

Open native Shell

The following plugins allow to open a shell window from Eclipse. This allows to move the shell to a different monitor window

Execute Shell within a View

The following plugins allow to display the shell within an Eclipse view. While this is really integrating the shell in the IDE it does not allow to move the shell to a different screen.

Other means to launch a Maven command

There are other ways to launch Maven command without explicitly opening a shell:

    • m2e - allows to launch Maven commands without opening a shell
    • Maven shell

StartExplorer configured

Start explorer is my plugin of choice since it allows to start a shell external to the IDE and it is easily configurable.

Setting the Title

To find the right shell I configure the title to show the name of the project it is launched on.

Add to the Start Shell command title ${project_name}:

cmd.exe /c start /d ${resource_path} <b>title ${project_name}</b>

Shortcut Str-Alt-#

To quickly open the shell set the short-cut Str-Alt-# to Start Shell here (in Preferences/Keys) like this:

Extending Aliases

We added a new experiment to our Alias Maven Plugin. Our theory is, that users want to add to existing aliases, e.g. to change the colour of the terminal window, to beep on failure or to quit the window on successful termination of a build process. We call this alias extension.

The extended alias is added in addition to the existing aliases so that the user may call the original or the extended version of the alias. So if an alias i is used to run a Maven install, the extension aq (read as ... and quit) adds an alias iaq that runs the install process and closes the terminal after a successful execution.

i = mvn -T 4 clean install $*
iaq = @echo off $T mvn -T 4 clean install $*  ^&^& exit $T @echo on

There is a detailed example on the web site of the Alias Maven Plugin that shows an example of using the alias extension feature.

Alias extensions are available from version 0.2.0 on.